home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / taropyon / silib / inc / siwin.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  3.8 KB  |  120 lines

  1. /*************************************************************************
  2. *    "siwin.h"
  3. *-------------------------------------------------------------------------
  4. *    Window library
  5. *                                            Copyright (c) 1993, TaroPYON
  6. *************************************************************************/
  7.  
  8. #ifndef    _SIWIN_H
  9. #define    _SIWIN_H
  10.  
  11. #include    <time.h>
  12. #ifndef    _SIDEFS_H
  13. #    include    <sidefs.h>
  14. #endif
  15. #ifndef    _SICTRL_H
  16. #    include    <sictrl.h>
  17. #endif
  18. #ifndef    _SISCN_H
  19. #    include    <siscn.h>
  20. #endif
  21.  
  22. typedef struct    _win_t
  23. {
  24.     struct _win_t        *next, *prev;
  25.     struct _win_t        *parent, *child;    /* 未使用    */
  26.  
  27.     UINT        att;            /* 属性                    */
  28.     UINT        stt;            /* ステータス            */
  29.     int            prio;            /* プライオリティ        */
  30.     int            act;            /* アクティブフラグ        */
  31.     FRAME_T        fr;                /* 表示範囲                */
  32.     LAYER_T        *layer;            /* 仮想VRAM表示用        */
  33.     MSK_T        mskDsp;            /* 表示マスク用            */
  34.  
  35.     int            accChk;            /* アクセスチェック        */
  36.     time_t        accTime;        /* アクセスタイム        */
  37.     UINT        accCnt;            /* アクセスカウント        */
  38.  
  39.     int            page;            /* 表示ページ            */
  40.  
  41.     CLIP_T        *clpDrw;        /* 描画用(実際の描画に使用)    */
  42.     CLIP_T        *clpDsp;        /* 描画範囲(固定)                */
  43.     CLIP_T        *clpMsk;        /* マスク範囲                    */
  44.     MSK_T        msk;            /* マスク作業用                    */
  45.  
  46.     int            (*dspFunc)(struct _win_t *);
  47.                                 /* 表示関数                        */
  48.     int            (*ctrFunc)(struct _win_t *,int,...);
  49.                                 /* コントロール関数                */
  50.     void        *ptr;
  51.     void        *winCt;
  52. } WIN_T;
  53.  
  54. #define    WIN_ATT_DSPMSK    (0x0001_0000)    /* マスクを使用    */
  55.  
  56. #define    WIN_STT_OFF        (0x0000_0000)    /* 非表示        */
  57. #define    WIN_STT_SLEEP    (0x0000_0001)    /* 動作停止        */
  58. #define    WIN_STT_WAKE    (0x0000_0002)    /* 動作            */
  59.  
  60. #define    WINPRIO_BAS        ( 0)    /* ベースウィンドゥ        */
  61. #define    WINPRIO_APL        ( 8)    /* 一般アプリ            */
  62. #define    WINPRIO_DLG        (16)    /* ダイアログ            */
  63.  
  64. typedef    struct
  65. {
  66.     UINT            att;            /* 属性                */
  67.     UINT            stt;            /* ステータス        */
  68.     UINT            accCnt;            /* アクセスカウント    */
  69.  
  70.     COLOR_T            basCol;            /* 背景色            */
  71.  
  72.     int                winNum;            /* ウィンドゥ数        */
  73.     WIN_T            *winTop;        /* 表示順に並べる    */
  74.     WIN_T            *winLast;
  75. } WINCTRL_T;
  76.  
  77. extern WINCTRL_T        *SiWinCt;
  78.  
  79. /*----------------------------------------------------------------------*/
  80. #define    WINCT_STT_REWRTIGN    (0x0000_00001)    /* 画面書き換え禁止    */
  81.  
  82. /*----------------------------------------------------------------------*/
  83. extern int            WIN_sysInit(void);
  84. extern void            WIN_sysTerm(void);
  85. extern WINCTRL_T   *WIN_ctrlOpen(void);
  86. extern void            WIN_ctrlClose( WINCTRL_T *winCt);
  87. extern WIN_T       *WIN_openBasWin( WINCTRL_T *winCt, int (*func)(WIN_T *), void *ptr );
  88. extern int            win_moveSrv( WIN_T *win, FRAME_T *newFr );
  89. extern int            WIN_link(  WIN_T *win );
  90. extern WIN_T       *WIN_open( WINCTRL_T *winCt, int prio, int (*func)(WIN_T *), void *ptr );
  91. extern void            WIN_unlink( WIN_T *win );
  92. extern void            WIN_close( WIN_T *win );
  93. extern int            win_makeClip( WIN_T *topWin, CLIP_T **clpTop, FRAME_T *bsFr, FRAME_T *fr );
  94. extern int            win_makeDspClip( WIN_T *win );
  95. extern int            win_makeMoveClip( CLIP_T **clpTop, FRAME_T *bsFr, FRAME_T *fr );
  96. extern int            win_chkPoint( WIN_T *win, POINT_T *point );
  97. extern int            WIN_dsp( WIN_T *win, CLIP_T *clpFr );
  98. extern int            WIN_active( WIN_T *win );
  99. extern int            WIN_off( WIN_T *win );
  100. extern int            WIN_resize( WIN_T *win, FRAME_T *newFr );
  101. extern int            WIN_redsp_all(WINCTRL_T *winCt);
  102.  
  103. typedef struct
  104. {
  105.     CLIP_T        clpWork;
  106.     CLIP_T       *clpSave;
  107. } WINCLIPWORK_T;
  108.  
  109. extern int            WIN_setClip(WIN_T *win, WINCLIPWORK_T *work);
  110. extern int            WIN_resetClip(WIN_T *win, WINCLIPWORK_T *work);
  111.  
  112. /*----------------------------------------------------------------------*/
  113. extern void            ClipFree( REG CLIP_T *clpTop );
  114. extern int            ClipDup( CLIP_T **clpNew, CLIP_T *clpSrc );
  115. extern int            ClipMix( CLIP_T **newFr, CLIP_T *clpDsp, CLIP_T *clip );
  116.  
  117. /*----------------------------------------------------------------------*/
  118.  
  119. #endif
  120.